package fr.vvins.core.user.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.catalog.entity.Product;
import fr.vvins.core.catalog.entity.Vigneron;
import fr.vvins.core.dao.EntityImpl;


/**
 * Favorite entity
 */
@Entity
@Table(schema="vvins", name="VV_FAVORITE")

public class Favorite extends EntityImpl implements Serializable {

	private static final long serialVersionUID = -2302974740707092132L;
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;
	@ManyToOne
	@JoinColumn(name="VIGNERON_ID")
	private Vigneron vigneron;
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")
	private Product product;
	
	public Favorite() {
	}
	
	public Favorite(User user, Vigneron vigneron, Product product) {
		super();
		this.user = user;
		this.vigneron = vigneron;
		this.product = product;
	}

	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Vigneron getVigneron() {
		return vigneron;
	}

	public void setVigneron(Vigneron vigneron) {
		this.vigneron = vigneron;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	
}
